#!/bin/sh
# PCP QA Test No. 1878
# check _is_archive from utilproc.c ... was broekn for V3 archives
#
# Copyright (c) 2022 Ken McDonell.  All Rights Reserved.
#

if [ $# -eq 0 ]
then
    seq=`basename $0`
    echo "QA output created by $seq"
else
    # use $seq from caller, unless not set
    [ -n "$seq" ] || seq=`basename $0`
    echo "QA output created by `basename $0` $*"
fi

# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check

if [ ! -f $PCP_LIBADM_DIR/utilproc.sh ]
then
    _notrun "$PCP_LIBADM_DIR/utilproc.sh not installed"
    # NOTREACHED
fi

. $PCP_LIBADM_DIR/utilproc.sh

_cleanup()
{
    cd $here
    $sudo rm -rf $tmp $tmp.*
}

status=0	# success is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15

# real QA test starts here
echo "Usage botch"
_is_archive
echo sts=$?

for arg in /no/such/file tmparch/foo_v2.meta tmparch/foo_v3.0
do
    echo
    echo "=== $arg ==="
    _is_archive $arg
    echo sts=$?
done

# success, all done
exit
